package com.javafactroy.kunlong.data.entity.postgres;

import com.javafactroy.kunlong.client.feign.dto.PageInfoDto;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

@Data
@Table(name = "information_schema.COLUMNS")
@Accessors(chain = true)
public class PostgresColumns extends PageInfoDto {

    @Column(name = "IS_NULLABLE")
    String nullFlag; //"NO",
    @Column(name = "TABLE_NAME")
    String tableName;

    @Column(name = "table_catalog")
    String dbName;
    @Column(name = "COLUMN_NAME")
    String colName;

    @Transient
    @Column(name = "COLUMN_KEY")
    String colKey;
    // NUMERIC_PRECISION":8,
    //"PRIVILEGES":"select,insert,update,references",
    @Transient
    @Column(name = "COLUMN_COMMENT")
    String comment;
    //"NUMERIC_SCALE":2,udt_name
    @Column(name = "data_type")
    String colType;
    //"GENERATION_EXPRESSION":"",

    @Column(name = "ORDINAL_POSITION")
    String pos;

    @Column(name = "udt_name")
    String dataType;

    @Column(name = "COLUMN_DEFAULT")//column_default
    String colDefault;

    @Column(name = "character_maximum_length")
    Long maxLength;

}
